package org.eclipse.jdt.internal.ui.callhierarchy;

import java.util.ArrayList;
import java.util.List;

public class Exceptions {
	
	private List<String> exs = new ArrayList<String>();

	public Exceptions() {
	}
	
	public void add(String ex) {
		exs.add(ex);
	}
	
	public String toString() {
		StringBuilder throwsString = new StringBuilder();
		if (exs.size() > 0) {
			throwsString.append("throws "+ exs.get(0));
			
			for (int i = 1; i < exs.size(); i++) {
				throwsString.append(", " + exs.get(i));
			}
		}
		
		return throwsString.toString();
	}
}
